<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">

var payment_datagrid;
$(function() {
	payment_datagrid = $('#payment_datagrid').datagrid({
		url : '${pageContext.request.contextPath}/ContractController/dataGrid',
		pagination : true,
		fit : true,
		rownumbers : true,
		fitColumns : true,
		border : false,
		idField : 'paymentId',
		pageSize : 20,
		pageList : [ 20, 40, 60, 80, 100 ],
		sortName : 'payDate',
		sortOrder : 'desc',
		checkOnSelect : true,
		selectOnCheck : true,
		nowrap : false,
		toolbar : [ {
			text : '添加',
			iconCls : 'icon-add',
			handler : function() {
				addFun();
			}
		}, '-', {
			iconCls : 'icon-edit',
			text : '编辑',
			handler : function() {
				editFun();
			}
		}, "-", {
			text : '删除',
			iconCls : 'icon-remove',
			handler : function() {
				delFun();
			}
		}, "-", {
			text : '批量导入',
			iconCls : 'icon-add',
			handler : function() {
				betchAdd();
			}
		} ],
		frozenColumns : [ [ {
			field : 'paymentId',
			title : '编号',
			width : 80,
			checkbox : true
		}, {
			field : 'paymentCode',
			title : '发票编码',
			width : 60,
			sortable : true
		} ] ],
		columns : [ [ {
			field : 'po',
			title : '合同编号',
			width : 20,
			align : 'center',
			sortable : true
		}, {
			field : 'contractName',
			title : '合同名称',
			width : 20,
			align : 'center',
			sortable : true
		},{
			field : 'contractName',
			title : '合同名称',
			width : 20,
			align : 'center',
			sortable : true
		}, {
			field : 'paymentAmount',
			title : '付款金额',
			align : 'center',
			width : 10,
			formatter : function(value, row, index) {

				return (accounting.formatNumber(value));
			}

		}, {
			field : 'payDate',
			title : '开票时间',
			align : 'center',
			width : 10,
			sortable : true,
			formatter : function(value, row, index) {
				if (value != null) {
					value = new Date(value).format("yyyy-MM-dd");
				}
				return value;
			}
		} ] ]

	});

});

</script>
</head>


<body>
	<div id="paymentlayout" class="easyui-layout" style="height: 550px">
		<div class="easyui-layout" data-options="fit : true">
			<div data-options="region:'center'">
				<table id="payment_datagrid" fitColumns="true">
				</table>
			</div>
		</div>

		<div id="rightClickMenu" class="easyui-menu" style="width: 120px;">
			<div onclick="addFun();" data-options="iconCls:'pencil_add'">增加</div>
			<div onclick="delFun();" data-options="iconCls:'pencil_delete'">删除</div>
			<div onclick="editFun();" data-options="iconCls:'pencil'">编辑</div>
		</div>
	</div>
</body>

</html>
